﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:local="clr-namespace:CBR.Components.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

	<Style x:Key="BrowseForControlTextBoxStyle" TargetType="{x:Type TextBox}">
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{DynamicResource CbrForegroundBrush}"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="AllowDrop" Value="false"/>
		<Setter Property="Cursor" Value="Arrow"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
						<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource CbrForegroundDisabledBrush}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="{x:Type local:BrowseForControl}" TargetType="{x:Type local:BrowseForControl}">
		<Setter Property="MinHeight" Value="22"/>
		<Setter Property="Foreground" Value="{DynamicResource CbrForegroundBrush}"/>
		<Setter Property="Background" Value="{DynamicResource CbrTextBoxBackground}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:BrowseForControl}">
					<Border BorderThickness="0" IsEnabled="{TemplateBinding IsEnabled}"
							Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
						<Grid IsEnabled="{TemplateBinding IsEnabled}" Margin="1" >
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
							<TextBox HorizontalAlignment="Stretch" Grid.Column="0" x:Name="PART_Box" 
									 Text="{TemplateBinding Selection}" IsReadOnly="true" 
									 Style="{DynamicResource BrowseForControlTextBoxStyle}" />
							<Button Style="{DynamicResource CbrStandardButton}" HorizontalAlignment="Right" Grid.Column="1" x:Name="PART_Button" Width="22" Content="..."/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True" >
							<Setter Property="Background" Value="{DynamicResource CbrTextBoxBackgroundSelected}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" Value="{DynamicResource CbrBackgroundDisabledBrush}"/>
							<Setter Property="Foreground" Value="{DynamicResource CbrForegroundDisabledBrush}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
</ResourceDictionary>